﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Einstein.Data;
using Einstein.Group.DAL;
using Einstein.Group.Model;

namespace Einstein.Group.BLL
{
    public class DeviceInfoBLL
    {
        public static IList<DeviceInfoModel> SelectAllModel()
        {
            var list = SelectAll();
            IList<DeviceInfoModel> models = new List<DeviceInfoModel>();
            foreach (var info in list)
            {
                models.Add(DeviceInfoModel.Load(info));
            }
            return models;
        }

        public static IList<DeviceInfo> SelectAll()
        {
            return new DeviceInfoDAL().SelectAll();
        }

        public static bool Add(DeviceInfo info)
        {
            return new DeviceInfoDAL().Add(info);
        }


        public static bool Exist(string deviceNO)
        {
            return new DeviceInfoDAL().Exist(deviceNO);
        }

        public static bool Update(string deviceNO, string ip)
        {
            return new DeviceInfoDAL().Update(deviceNO, ip);
        }

        public static bool Update(DeviceInfo info)
        {
            return new DeviceInfoDAL().Update(info);
        }

        public static bool Delete(string deviceNO)
        {
            return new DeviceInfoDAL().Delete(deviceNO);
        }

        public static DeviceInfo Selete(string deviceNO)
        {
            return new DeviceInfoDAL().Selete(deviceNO);
        }

    }

}
